<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>汽车编辑</title>
		 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
         <meta name="apple-mobile-web-app-capable" content="yes">
         <meta content="yes" name="apple-touch-fullscreen">
         <meta name="apple-mobile-web-app-status-bar-style" content="black">  
         <script src="js/add_js.js"></script>
	</head>
    <body>
    	<!--nav-->
        <nav class="bar bar-tab">
             <a class="tab-item external active" href="home.html">我的账户</a>
             <a class="tab-item external" href="order.html">定单</a>
             <a class="tab-item external" href="carRental.html">租车</a>
             <a class="tab-item external" href="rentalCar.html">出租</a>
             <div class="clear"></div>
        </nav>
    <!--nav-->
       <div class="page content" >
      	 <header class="bar bar-nav">
               <a  class="button button-link button-nav pull-right active">车辆详情</a>
               <a href="carManger.html" class="button button-link button-nav pull-right">返回车辆管理 </a>
            </header>
      		<div class="carManger-list">
      			<ul>
      				<li style="border:none">
      				<div class="carManger-list-img">
      					<div class="swiper-container">
                               <div class="swiper-wrapper">
                                <div class="swiper-slide"><img src="img/car.jpg"> </div>
                                 <div class="swiper-slide"><img src="img/car.jpg"></div>
                                 <div class="swiper-slide"><img src="img/car.jpg"></div>
                               </div>
                               <div class="swiper-pagination" style="text-align: right;"></div>
                        </div>
                        <div class="carEdit-img-add">
                        	<div><img src="img/icon/sq.png">删除</div>
      				      <div class="carEdit-img-tj"><img src="img/icon/j.png">添加</div>
      			        </div>
      				</div>
      				</li>
      				<li><div class="carManger-list-top"><div>
      					<span><img src="img/icon/qcc.png"></span>
      					<p class="brand_chinese_name">汽车名字</p><div class="clear"></div></div>
      					<div class="car_plate">车牌号码</div>
      					<div class="auditresult_state"><img src="img/icon/ok.png" style="width:15px;margin: 0 5px -2px 0;display:inline-block;">认证通过</div></div>
      					<div class="carEdit-list"><span>小型轿车</span><span>小车辆类型</span></div>
      					<div class="carEdit-list"><span>成张</span><span>所有人</span></div>
      					<div class="carEdit-list"><span>02102012</span><span>车辆识别代号</span></div>
      				</li>
      				
      			</ul>
      	    </div>
      	    <script>
      	    $(document).ready(function(){
      	    	 
      	    	 if(my.checkLogin()){
      	    	   my.scollToggleBar()
      	    	   $.showIndicator()
      	    	   key=my.get_key(my.getCookie('token'))
                 //获取照片
                  var info={
      						     //'u_userid':sessionStorage.id,
      						     'cars_id':sessionStorage.car_id,
      					                }
    					info=JSON.stringify(info)
                        info=my.cryptoASEencrypt(info,key).toString()
                        $.ajax({
      					url:"http://192.168.1.10:8082/index.php?r=userabout%2Fuser%2Fgetcarsinfo",
      					type: 'post',
      					async:true,
      					data:{
      						'api_value':info
      					},
      					error:function(){
      						    $.hideIndicator()
      							$.toast("请求失败，请刷新重试");
      						},
      					success:function(data){
      						if(data.match("err_code")!=null){
      							$.hideIndicator()
      							switch(JSON.parse(data).err_code)
      								{
      									case 40003:
      									    my.tokenExpire()
      									   break;
      									default:
      									   $.toast(JSON.parse(data).err_msg);
      								}     
      							}else{
      								$.hideIndicator()
      								data=JSON.parse(my.cryptoASEdencrypt(data,key))
      							    for(i=0;i<data['carimg'].length;i++){
      							    	var src='<div class="swiper-slide"><img src="http://192.168.1.10:8083/'+data['carimg'][i].image_bigurl+'">'
      							    	$(src).appendTo('.swiper-wrapper')
      							    }
      							     var mySwiper = new Swiper('.swiper-container',{
                                             pagination : '.swiper-pagination',
                                             paginationElement : 'li',
                                          })
      							}
      					}
      				});
                 //添加照片
                 $('.carEdit-img-tj').click(function(){
                 	 var list={"id":".carEdit-img-tj","text":""}
      			         list=JSON.stringify(list)
      				     ad.native_get_photo(list)
                 	    $.confirm('确认上传么？', function () {
                 	    $.showIndicator()
                 	    	var info={
      						     //'u_userid':sessionStorage.id,
      						     'u_userid':my.getCookie('id'),
      						     'cars_id':sessionStorage.car_id,
      						     'cars_img':$('.carEdit-img-tj').attr('name'),
      					               }
    					info=JSON.stringify(info)
                        info=my.cryptoASEencrypt(info,key).toString()
                 	    $.ajax({
      					   url:"http://192.168.1.10:8082/index.php?r=userabout%2Fuser%2Fuploadcarimg",
      					   type: 'post',
      					   async:true,
      					   data:{
      						      'api_value':info
      					        },
      					    error:function(){
      					    	$.hideIndicator()
      					    	$.router.reloadPage();
      							$.toast("图片上传失败,请重新上传");
      						},
      					    success:function(data){
      						if(data.match("err_code")!=null){
      							$.hideIndicator()
      							switch(JSON.parse(data).err_code)
      								{
      									case 40003:
      									    my.tokenExpire()
      									   break;
      									default:
      									   $.router.reloadPage();
      									   $.toast(JSON.parse(data).err_msg);
      								}     
      							}else{
      							$.router.reloadPage();
      							$.toast('图片上传成功');
      							
      						}
      					}
      				});              		
                 	   })
                 	
                 })
      	       }
      		})
      	    </script>
      	</div>
      	
	</body>
</html>
